import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/button/radius_button.dart';
import 'package:boss/ui/widget/image/base_image.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class EmptyWidget extends StatelessWidget {
  final String icon;
  final String title;
  final String btnText;
  final VoidCallback onTap;

  const EmptyWidget({
    Key key,
    this.icon,
    this.title,
    this.btnText,
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          BaseImage(
            icon ?? 'assets/image/empty_icon.png',
            width: 280.w,
            height: 240.w,
          ),
          Container(
            margin: EdgeInsets.only(top: 20.w),
            child: Text(
              title ?? '暂无数据',
              style: TextStyleConstant().normal_6_26,
            ),
          ),
          if (btnText != null)
            RadiusButton(
              margin: EdgeInsets.only(top: 100.w),
              width: 590.w,
              title: btnText,
              onTap: onTap,
            )
        ],
      ),
    );
  }
}
